package com.e3.basdoc.warehouse.client;

import java.util.List;

import com.e3.basdoc.warehouse.model.WarehouseModel;
import com.e3.template.tgf.MyGFUI;
import com.e3.template.tgf.TGFEditorDialog;
import com.e3.template.tgf.TGFGridPanel;
import com.e3.template.tgf.TGFQueryDialog;
import com.e3.template.tgf.TGFSimpleFormPanel;
import com.google.gwt.user.client.rpc.AsyncCallback;

public class WarehouseUI extends MyGFUI<WarehouseModel> {
	
	private WarehouseRPCServiceAsync service = WarehouseRPCService.Util.getInstance();

	@Override
	protected TGFSimpleFormPanel<WarehouseModel> createFormPanel() {
		return new WarehouseFormPanel();
	}

	@Override
	protected TGFGridPanel<WarehouseModel> createGridPanel() {
		return new WarehouseGridPanel();
	}

	@Override
	protected TGFQueryDialog<WarehouseModel> createQueryDialog() {
		return new WarehouseQueryDialog();
	}

	@Override
	protected TGFEditorDialog<WarehouseModel> createEditorDialog() {
		return new WarehouseEditorDialog();
	}

	@Override
	protected void executeDeleteService(final List<WarehouseModel> models,AsyncCallback<Void> callback) {
		service.deleteWarehouses(models, callback);
	}

	@Override
	protected String getCurrentLocalName() {
		return WarehouseMessages.INSTANCE.local_name();
	}

	@Override
	protected WarehouseModel createModelInstance() {
		return WarehouseHelper.INSTANCE.createModelInstance();
	}

}
